package com.sy.mapper;

import com.sy.dto.CollectDto;
import com.sy.entity.Collect;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * description: CollectMapper <br>
 * date: 2022/6/24 1:39 AM <br>
 * author: zoumaoji <br>
 * version: 1.0 <br>
 */
public interface CollectMapper {
    /**
     * 查找用户收藏
     * @param memberId
     * @return
     */
    List<CollectDto> showCollectSubject(Integer memberId);

    /**
     * 用户添加收藏
     * @param memberId
     * @param subjectId
     * @return
     */
    boolean addCollect(@Param("memberId") Integer memberId,@Param("subjectId")Integer subjectId);

    /**
     * 删除用户收藏
     * @param memberId
     * @param subjectId
     * @return
     */
    boolean delCollect(@Param("memberId") Integer memberId,@Param("subjectId")Integer subjectId);

    /**
     * 是否存在此收藏
     * @param memberId
     * @param subjectId
     * @return
     */
    Collect isExistCollect(@Param("memberId") Integer memberId,@Param("subjectId")Integer subjectId);
}
